var express = require('express');
var router = express.Router();

var userController = require("../../app/controllers/user/userController");
var groupController = require("../../app/controllers/user/groupController");

module.exports = function(){
  /* GET home page. */
  router.get('/', function(req, res, next) {
  	console.log(req.app);
    res.render('index', { title: 'Express' });
  });

  //register router
  router.get('/user/index',userController.index);
  router.get('/user/index',userController.index);

  //error
  // router.use('/group',function(){
  // 	router.all('/index',groupController.index);
  	
  // });

  router.use('/', groupController.init(router));

  return router;
};
